﻿using LineOfBusiness.Controls.Extensions;
using LineOfBusiness.Core.Helper;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace LineOfBusiness
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ModelBinders.Binders[typeof(object)] = new DynamicEntityModelBinder();
            ModelBinders.Binders[typeof(DateTime)] = new DateTimeBinder();

            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new LOBRazorViewEngine());

            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("vi-VN");
            
        }

        
    }
}
